<!DOCTYPE html>
<html class=" js csstransforms3d" lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.thymeleaf.org/thymeleaf-extras-shiro">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>系统管理员管理</title>
    <link rel="stylesheet" th:href="@{~/static/css/base.css}" href="../static/css/base.css">
    <link rel="stylesheet" th:href="@{~/static/css/page.css}" href="../static/css/page.css">
    <script type="text/javascript" th:src="@{~/static/js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{~/static/js/modernizr.js}"></script>
    <script type="text/javascript" th:href="@{~/static/js/jquery-3.3.1.min.js}" src="../static/js/jquery-3.3.1.min.js"></script>
</head>
<script>
    UrlParm = function() { // url参数
        var data, index;
        (function init() {
            data = [];
            index = {};
            var u = window.location.search.substr(1);
            if (u != '') {
                var parms = decodeURIComponent(u).split('&');
                for (var i = 0, len = parms.length; i < len; i++) {
                    if (parms[i] != '') {
                        var p = parms[i].split("=");
                        if (p.length == 1 || (p.length == 2 && p[1] == '')) { // p | p=
                            data.push(['']);
                            index[p[0]] = data.length - 1;
                        } else if (typeof(p[0]) == 'undefined' || p[0] == '') { // =c | =
                            data[0] = [p[1]];
                        } else if (typeof(index[p[0]]) == 'undefined') { // c=aaa
                            data.push([p[1]]);
                            index[p[0]] = data.length - 1;
                        } else { // c=aaa
                            data[index[p[0]]].push(p[1]);
                        }
                    }
                }
            }
        })();
        return {
            parm: function(o) { // o: 参数名或者参数次序
                try {
                    return (typeof(o) == 'number' ? data[o][0] : data[index[o]][0]);
                } catch (e) {}
            },
            parmValues: function(o) { //  o: 参数名或者参数次序
                try {
                    return (typeof(o) == 'number' ? data[o] : data[index[o]]);
                } catch (e) {}
            },
            hasParm: function(parmName) {
                return typeof(parmName) == 'string' ? typeof(index[parmName]) != 'undefined' : false;
            },
            parmMap: function() {
                var map = {};
                try {
                    for (var p in index) {
                        map[p] = data[index[p]];
                    }
                } catch (e) {}
                return map;
            }
        }
    }();
</script>
<script>
    $(function () {
        var page= UrlParm.parm("page")
        $.ajax({
            url: "http://localhost/stytemManageList/limit/"+page,
            // url: "https://www.sixstarone.xyz/stytemManageList/limit/0/10",
            type: "GET",
            datatype: "jsonp",
            header: {
                'Content-Type': 'application/json'
            },
            async: false,
            success: function (res) {
                resultList=JSON.parse(res.result)
                if (resultList.length > 0) {
                    var listResult = "";
                    var pageResult="";
                    var pageResultPre = "";
                    var pageResultLast = "";
                    var pageCount=res.page.pageCount;
                    $("#pageSelectList").empty().append(`<span>共 <b>${res.page.listCount}</b> 条 </span>`)
                    for (var i = 0; i < resultList.length; i++) {
                        listResult += `<tr >
                           <td class="t_1" >${resultList[i].admin_id}</td>
                            <td class="t_3">${resultList[i].admin_name}</td>
                            <td class="t_3">${resultList[i].admin_acc}</td>
                            <td class="t_3">${resultList[i].perms}</td>
                            <td class="t_3">${resultList[i].role}</td>
                            <td class="t_4">
                                <div class="btn">
                                <a href="manage_edit.html?id=${resultList[i].admin_id}"  class="modify">修改</a>
                                <a href="delect.html?id=${resultList[i].admin_id}&&method=delectAdmin"  class="delete">删除</a>
                                </div>
                            </td>
                        </tr>`
                    }
                    $("#list").empty().append(listResult)
                    pageResultPre = ` <div class="pageSelect" id="pageSelect">
                        <div id="pageSelectList">
                        </div>
                        <div class="pageWrap">
                            <a class="pagePre"><i class="ico-pre">&nbsp;</i></a>`
                    pageResultLast = `<a href="#" class="pagenext"><i class="ico-next">&nbsp;</i></a>
                        </div>
                    </div>`
                    for (var i = 0; i < pageCount; i++) {

                        if (page==i+1){
                            pageResultItem=`<a href = "manage_list.html?page=${i+1}" class = "pagenumb cur">${i+1}</a>`
                        }else {
                            pageResultItem=`<a href = "manage_list.html?page=${i+1}" class = "pagenumb">${i+1}</a>`
                        }
                        pageResult+=pageResultItem
                    }
                    $("#pageSelectList").append(pageResultPre+pageResult+pageResultLast)
                }
            }
        })
    })
</script>


<body style="background: #f6f5fa;">

<!--content S-->
<div class="super-content">
    <div class="superCtab">
        <div class="ctab-title clearfix"><h3>系统管理员管理</h3>
        </div>
        <div class="ctab-Main">
            <div class="ctab-Main-title">
                <ul class="clearfix">
                    <li><a href="user_info_List.html?page=1">用户管理</a></li>
                    <li><a href="info_manage_List.html?page=1">资料管理员信息</a></li>
                    <li class="cur"><div shiro:hasRole="administrator" ><a href="manage_list.html?page=1">系统管理员管理</a></div></li>
                </ul>
            </div>
            <div class="ctab-Mian-cont">
                <div class="Mian-cont-btn clearfix">
                    <div class="btn" ><a href="manage_edit.html?admin_id=${res[i].admin_id}" class="modify">
                    <!--添加管理员-->
                    </a></div>

                </div>

                <div class="Mian-cont-wrap">
                    <div class="defaultTab-T">
                        <table border="0" cellspacing="0" cellpadding="0" class="defaultTable">
                            <tbody>
                            <tr>
                                <th class="t_1">管理员id</th>
                                <th class="t_3">管理员用户名</th>
                                <th class="t_3">管理员账号</th>
                                <th class="t_3">管理员权限</th>
                                <th class="t_3">管理员角色</th>
                                <th class="t_4">操作</th>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <table border="0" cellspacing="0" cellpadding="0" class="defaultTable defaultTable2">
                        <tbody id="list">

                        </tbody>
                    </table>
                    <!--pages S-->
                    <div class="pageSelect" id="pageSelect">
                        <div id="pageSelectList">
                        </div>
                        <div className="pageWrap" id="pageWrap">
                            <a className="pagePre"><i className="ico-pre">&nbsp;</i></a>
                            <div id="pageIndex">
                            </div>
                            <a href="#" className="pagenext"><i className="ico-next">&nbsp;</i></a>
                        </div>
                    </div>
                    <!--pages E-->
                </div>
            </div>
        </div>
    </div>
    <!--main-->

</div>

</body>
</html>